//
//  VIPBaseVideoManager.h
//  TTProduct
//
//  Created by Taurin on 2019/12/25.
//  Copyright © 2019 TTProduct. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "VIPRTCProtocol.h"
#import "VIPRTCAgoraModel.h"
#import "VIPRTCZegoModel.h"

NS_ASSUME_NONNULL_BEGIN

// 动态创建远端View
typedef void (^LiveRealTimeRemoteView)(NSUInteger uid);
// 创建成功后回调
typedef void (^LiveRealTimeHandler)(NSView *view);

@interface VIPBaseVideoManager : NSObject <VIPRTCProtocol>

+ (instancetype)shareManager;

@property (strong, nonatomic) VIPBaseRTCModel *rtc;
@property (assign, nonatomic) NSUInteger uid;

@property (weak, nonatomic, readonly) NSView *localView;
// 实时创建远端View回调
@property (copy, nonatomic) LiveRealTimeRemoteView realTimeRemoteView;
// 创建成功后回调
@property (copy, nonatomic, readonly) LiveRealTimeHandler remoteViewHandler;

@property (copy, nonatomic) LiveLocalWillJoin localWillJoin;
// 本地已经进入回调
@property (copy, nonatomic) LiveLocalDidJoined localDidJoined;
// 本地重新进入回调
@property (copy, nonatomic) LiveLocalDidReJoined localReJoined;
// 本地第一帧回调
@property (copy, nonatomic) LiveFirstVideoDecoded localFirstVideoDecoded;

// 远端进入回调
@property (copy, nonatomic) LiveRemoteDidJoined remoteDidJoined;
// 远端第一帧回调
@property (copy, nonatomic) LiveFirstVideoDecoded remoteFirstVideoDecoded;

- (void)remoteDidJoined:(NSUInteger)uid completionHandler:(nullable void (^)(NSView *remoteView))completionHandler;

// 视频(关闭/打开)回调
@property (copy, nonatomic) LiveDidStreamMuted didVideoMuted;
// 音频(关闭/打开)回调
@property (copy, nonatomic) LiveDidStreamMuted didAudioMuted;

@property (copy, nonatomic) LiveVideoNetworkQuality videoNetworkQuality; // 视频质量回调
@property (copy, nonatomic) LiveAudioVolumeIndication audioVolumeIndication; // 音频质量回调

// 有用户离开
@property (copy, nonatomic) LiveDidOffline remoteDidOffline;
// Token已经失效
@property (copy, nonatomic) LiveTokenDidFailure tokenDidFailure;

@end

NS_ASSUME_NONNULL_END
